import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";

// 回款记录查询参数类型
export interface PaymentRecordQueryParams {
  page: number; // 页码
  size: number; // 每页数量
  orderNo?: string; // 订单编号
  paymentChannel?: string; // 回款渠道
  paymentSn?: string; // 回款流水号
  startDate?: string; // 开始日期
  endDate?: string; // 结束日期
}

export const createPaymentRecord = (data: object) => {
  console.log("回款:", data);
  return http.request<any>("post", baseUrlApi("order/rj/payment/create"), {
    data
  });
};

export const getPaymentRecordList = (data: PaymentRecordQueryParams) => {
  return http.request<any>("post", baseUrlApi("order/rj/payment/list"), {
    data
  });
};
